home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Forward task -- Slave Task routine *)
- (* *)
- (* Copyright 1988, 1989, 1990, 1991, 1992 by H. Roy Engehausen. All *)
- (* rights reserved. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* This starts the slave task *)
- (*===========================================================================*)
-
- PROCEDURE forward_to_remote;
-
- VAR
- path_common : path_block_ptr;
-
- BEGIN;
-
- path_common := path_common_temp;
-
- (*-----------------------------------------------------------------------*)
- (* Initialize the control blocks *)
- (*-----------------------------------------------------------------------*)
-
- active_port^.connected^[active_tcb^.channel] := active_tcb;
- IF (active_port^.port_type = port_modem)
- OR (active_port^.port_type = port_null_modem) THEN
- active_port^.cr_timeout := 1;
-
- active_tcb^.tcb_type := th_fwd_slave;
- active_tcb^.tcb_name := path_common^.path_target;
- active_tcb^.window := window_connect;
- active_tcb^.tcb_connect := TRUE;
- active_tcb^.uid_data.user_id := path_common^.path_call;
- active_tcb^.uid_data.user_ssid := '';
- active_tcb^.uid_data.user_class := user_c_bu;
- active_tcb^.uid_data.user_flag := user_f_bbs;
-
- (*-----------------------------------------------------------------------*)
- (* Allow some other catchup work to clear *)
- (*-----------------------------------------------------------------------*)
-
- task_switch;
- task_switch;
-
- (*-----------------------------------------------------------------------*)
- (* Delay as needed to let any outstanding packets clear. *)
- (*-----------------------------------------------------------------------*)
-
- IF (path_common^.path_delay)
- AND (active_port^.port_type <> port_g8bpq)
- AND (active_port^.port_type <> port_bpqhost) THEN
- BEGIN;
- task_wait(opt_block.fwd_delay, FALSE);
- path_common^.path_delay := FALSE;
- END;
-
- (*-----------------------------------------------------------------------*)
- (* Main forwarding *)
- (*-----------------------------------------------------------------------*)
-
- forward_main(path_common);
-
- (*-----------------------------------------------------------------------*)
- (* Reverse forward if Advanced BBS and it requests it or it is a PBBS *)
- (*-----------------------------------------------------------------------*)
-
- IF ((active_tcb^.tcb_abbs) AND (active_tcb^.tcb_bid_level > 0))
- OR ((active_tcb^.uid_data.user_flag AND user_f_pbbs) <> 0) THEN
- forward_rev(path_common); (* forward_rev never exits! *)
-
- (*-----------------------------------------------------------------------*)
- (* Done *)
- (*-----------------------------------------------------------------------*)
-
- end_session(TRUE);
-
- END;